import {getAuthToken} from '@/common/js/util.js'
import {BASE_URL} from '@/common/js/request.js'

export function listSimpleDictDatas() {
	// return request({
	//   url: 'http://192.168.31.235:48080/dev-api/admin-api/system/dict-data/list-all-simple',
	//   method: 'get'
	// })
	return new Promise((resolve, reject) => {
		const authToken = getAuthToken();
		uni.request({
			// url: 'http://192.168.31.165:48080/app-api/appSystem/dict-data/list-all-simple',
			// url: 'https://api.jinrui.cloud/app-api/appSystem/dict-data/list-all-simple',
			url: BASE_URL+'/app-api/appSystem/dict-data/list-all-simple',
			method: 'GET',
			data: {},
			header: {
				'tenant-id': '1',
				'Authorization': authToken ? `Bearer ${authToken}` : ''
			}
		}).then(res => {
			resolve(res[1].data);
		})
	})
}
